package Java字符串;

public class 字符串的替换{
	   public static void main(String args[]){
	      String str="Hello World";
	      System.out.println( str.replace( 'H','W' ) );//将H替换成W
	      System.out.println( str.replaceFirst("He", "Wa") );
	      System.out.println( str.replaceAll("He", "Ha") );
	   }
	}